home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 October / macformat-029.iso / mac / Shareware City / Developers / Selection ƒ 2.5 / checkBox+ < prev    next >
Encoding:
Text File  |  1994-11-06  |  704 b   |  47 lines  |  [TEXT/MSET]

  1.  \ 28Oct94 dbh updated to 2.5 syntax 
  2.  
  3. (*
  4.  
  5. A pushButton and checkBox+ will function as is without any required
  6. setup.  They have default titles and positions, and will respond
  7. appropriately to mouse clicks.  These controls are selection objects.
  8. Action handlers must be installed in order for these controls to actually
  9. do anything.
  10.  
  11. *)
  12.  
  13. :class    CHECKBOX+  super{ pushButton }
  14.  
  15. :m toggle:
  16.     get: self
  17.     IF    0
  18.     ELSE 1
  19.     THEN  put: self ;m
  20.  
  21. :m exec:    ( part# -- )
  22.     IF
  23.         toggle: self
  24.         get: action execute
  25.     THEN ;m
  26.  
  27. :m CLASSINIT:
  28.       konst checkBoxProc  put: procID
  29.       " Checkbox+" put: cTitle ;m
  30.  
  31. ;class
  32.  
  33.  
  34. endload
  35.  
  36. *** EXAMPLE USE
  37.  
  38. selwindow w
  39. test: w
  40.  
  41. pushButton b
  42. b add: w
  43.  
  44. checkbox+ c
  45. 20 20 moveto: c
  46. c add: w
  47.